package cn.edu.ctbu.datajpa01.aspect;

import cn.edu.ctbu.datajpa01.helper.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExceptionHandle {

    @ExceptionHandler(Exception.class)
    public Result handle(Exception e){
        return Result.error(-999,e.getMessage());
    }
}
